home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Commander Sets / 4D Speech Pack / 4D Speech Pack.rsrc / TEXT_18507_†SP Voicename.txt < prev    next >
Encoding:
Text File  |  1994-09-14  |  3.1 KB  |  58 lines

  1. SP Voicename (index; voice) -> err
  2.  
  3. index          integer       specifys for the n-th voicename you want the
  4.                                     name from. This index must be in the range one
  5.                                     (1) to the count returned by the SP Count
  6.                            voices function (see above).
  7.                                     You can also pass the reference number obtained
  8.                                     from the SP Open Voice function. You can then
  9.                                     retrieve the name of the voice of that opened
  10.                                     speech channel which may be slightly different
  11.                                     from what you specified when calling
  12.                                     SP Open Voice. If the speech channel is
  13.                                     already closed an error will be returned (-244).
  14. voice          string (63) returns the voice name of the specified index or
  15.                                     reference.
  16. err             integer       returns the error which occured. 
  17.                                     A value of zero indicates no error occured. See 
  18.                                     below for a list of possible errors.
  19.  
  20. Returns the name of a voice based on an index number or reference number.
  21.  
  22. Don't assume using index 1 returns always ‚ÄùMarvin‚Äú. The index is the order in which the voices were found in the application and/or System Folder. After a restart this may have changed completely since the user can move, add or remove voice files.
  23. When the user switches to the Finder and installs or removes voice files (the user should restart after doing this) the index value becomes invalid. So, don't store the index of a particular voice.
  24.  
  25. If you use the ‚Äù*‚Äú wildcard as the voicename and you really want to know its real name, pass -2 as the index value and the name returned is that of the default voice.
  26. The same applies when you want to know which voice is behind the ‚Äù#‚Äú wildcard, then use -1 as the index value. Don't start a loop with -2 or -1 because you then will find the same voice twice.
  27.  
  28. Examples:
  29.   `if you make sure the $i variable in the range 1 to SP Count voices:
  30.   $err := SP Voicename ($i;$voicename)
  31.  
  32.   `and to get the name of the default voice
  33.   $err := SP Voicename (-2;$voicename)
  34.  
  35.   `if you want a random chosen voice:
  36.   `$count was filled with the number of voices using
  37.   `SP Count Voices (see above)
  38.   $err := SP Voicename (Random%$count+1;$voicename)
  39.  
  40.   `to get the name of the voice of a open speech channel:
  41.   $err := SP Voicename ($speechref;$voicename)
  42.  
  43.   `see also the example code with the SP Count Voices function
  44.   `for some reason this doesn't work:
  45.   ARRAY STRING (63;myArray;SP Count Voices)
  46.   $err := SP Voicename ($i;myArray{$i})
  47.  
  48. Possible errors:
  49.         0  No Error
  50.       -4  Speech Pack can not be used (Speech Mgr not available)
  51.     -50  Parameter error (inside external, not necessarily the
  52.             parameters you pass)
  53.   -108  Not enough memory to load voice into memory
  54.   -244  Voice resource not found (i.e. index out of range or channel
  55.            already closed)
  56.  
  57.  
  58.